package com.xy.farm.activity.my;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.xy.farm.R;
import com.xy.farm.activity.base.BaseActivity;
import com.xy.farm.activity.my.adapter.ShippingAddressAdapter;

/**
 * Created by 1174607250 on 2018/8/15.
 */

public class ShippingAddressActivity extends BaseActivity
{
    private RecyclerView recyclerView;
    private ShippingAddressAdapter adapter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shipping_address);
        findViewById(R.id.btn_back).setOnClickListener(this);
        findViewById(R.id.btn_add_address).setOnClickListener(this);
        recyclerView = findViewById(R.id.recyclerView);
        recyclerView.setHasFixedSize(true);
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(manager);
        recyclerView.setAdapter((adapter = new ShippingAddressAdapter()));
    }
    @Override
    public void onClick(View v)
    {
        super.onClick(v);
        Intent intent;
        switch (v.getId())
        {
            case R.id.btn_add_address:
                intent = new Intent(this, NewShippingAddressActivity.class);
                startActivity(intent);
                break;
        }
    }
}
